import request from '../utils/request';
import qs from 'qs';

export async function queryAnnounce(params) {
  return request(`/api/announce?${qs.stringify(params)}`, {
    credentials: 'include'
  });
}


export async function publishAnnounce(params) {
  return request('/api/announce', {
    method: 'POST',
    mode: 'cors',
    credentials: 'include',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    body: qs.stringify(params)
  });
}

export async function submitFeedback(params) {
  return request('/api/feedback', {
    method: 'POST',
    mode: 'cors',
    credentials: 'include',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    body: qs.stringify(params)
  });
}